/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package query;
import graph.*;
/**
 *
 * @author Gonzalo
 */
public class DDL{

    private String action="";
    private String type="";
    private String label="";



    public DDL(String _action,String _type,String _label){ // def type label
        action=_action;
        type=_type;
        label=_label;
    }

    public boolean isEdge(){
        return type.compareTo("edge")==0;
    }
    public boolean isString(){
        return type.compareTo("string")==0;
    }
    public void ejecutar(Schema s){
            if(isEdge())
                s.createEdgeType(label);
            else
                s.createAttributeType(label, type);
    }


    public String print(){
        return action+" "+type+" "+label;
    }

}
